﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FDEE.Model
{
    public class MZRebarRecord : RebarBase
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mBarMark"></param>
        /// <param name="sBarMark"></param>
        /// <param name="cBarMark"></param>
        /// <param name="diameter"></param>
        /// <param name="len"></param>      
        /// <param name="quantity"></param>
        /// <param name="shapeConfig"></param>
        public MZRebarRecord(int mBarMark, int sBarMark, string cBarMark, eDB diameter,
           int len, int quantity, eShapeType shapeConfig)
            : base(mBarMark, sBarMark, cBarMark, diameter, quantity, shapeConfig)
        {
            A = len;
        }
        public override void SetLength()
        {
            Length = A * 0.001;
            if (Length > 12 || Length < 0)
            {
                throw new Exception("MZ长度计算异常，请查找原因！");
            }
        }
        //钢筋圈数
    }


    public class MPIRebarRecord : RebarBase
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mBarMark"></param>
        /// <param name="sBarMark"></param>
        /// <param name="cBarMark"></param>
        /// <param name="diameter"></param>
        /// <param name="len"></param>      
        /// <param name="quantity"></param>
        /// <param name="shapeConfig"></param>
        public MPIRebarRecord(int mBarMark, int sBarMark, string cBarMark, eDB diameter,
           int len, int quantity, eShapeType shapeConfig,string gap1="", string gap2="")
            : base(mBarMark, sBarMark, cBarMark, diameter, quantity, shapeConfig)
        {
            A = len;
            Formula = "L="+ (A * 0.001).ToString("0.000") + "m";
            if (!string.IsNullOrWhiteSpace(gap1))
                Formula += "\\P"+ gap1;
            if (!string.IsNullOrWhiteSpace(gap2))
                Formula += "\\P" + gap2;
        }
        public override void SetLength()
        {
            Length = A * 0.001;
            if (Length > 12 || Length < 0)
            {
                throw new Exception("MZ长度计算异常，请查找原因！");
            }
        }
        //钢筋圈数
    }

    public class MPZRebarRecord : RebarBase
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mBarMark"></param>
        /// <param name="sBarMark"></param>
        /// <param name="cBarMark"></param>
        /// <param name="diameter"></param>
        /// <param name="len"></param>      
        /// <param name="quantity"></param>
        /// <param name="shapeConfig"></param>
        public MPZRebarRecord(int mBarMark, int sBarMark, string cBarMark, eDB diameter,
           int len, int quantity, eShapeType shapeConfig,double pileDia,string gap2hoke, string gap2hoke1="")
            : base(mBarMark, sBarMark, cBarMark, diameter, quantity, shapeConfig)
        {
            A = len;
            Formula = "L=" + (A * 0.001).ToString("0.000") + "m,Φ=" + pileDia.ToString("0.000") + "m";
            if (!string.IsNullOrWhiteSpace(gap2hoke))
                Formula += "\\P" + gap2hoke;
            if (!string.IsNullOrWhiteSpace(gap2hoke1))
                Formula += "\\P" + gap2hoke1;
        }
        public override void SetLength()
        {
            Length = A * 0.001;
            if (Length > 12 || Length < 0)
            {
                throw new Exception("MZ长度计算异常，请查找原因！");
            }
        }
        //钢筋圈数
    }
}


